import request from "@/utils/request";

// 智能设备档案

// 列表 错误码300021
export function list(params) {
  return request({
    url: "/device/archive/list",
    method: "get",
    params,
  });
}

// 详情 错误码300022
export function detail(id) {
  return request({
    url: `/device/archive/${id}`,
    method: "get",
  });
}
// 新增 错误码300023
export function add(data) {
  return request({
    url: "/device/archive",
    method: "post",
    data,
  });
}
// 编辑 错误码300024
export function edit(data) {
  return request({
    url: "/device/archive",
    method: "put",
    data,
  });
}

// 删除 错误码300025
export function del(id) {
  return request({
    url: `/device/archive/${id}`,
    method: "delete",
  });
}

// 统计 错误码300026
export function total(params) {
  return request({
    url: "/device/archive/getDeviceArchiveNum",
    method: "get",
    params,
  });
}

// 获取上级设备集合  错误码300027
export function pDeviceArr(params) {
  return request({
    url: "/device/archive/emeter/list",
    method: "get",
    params,
  });
}
